Calibre Reader for Windows and Linux 1.2
===========================================

What it does
- Reads the books of your calibre-web or calibre content servers (Settings > Add a Library),
  and keeps a Local Library of book files on this computer (Local Library > Import Books...).
- Reads EPUB, KEPUB, MOBI, AZW3 and TXT books (words drawn by the app, with Themes & Settings:
  text size, serif or not, line spacing, white, sepia or dark pages; Contents; arrow keys, Page Up/Down),
  and PDFs (pages drawn as they come into view, zoom in and out). Your place in each book is kept.
- Shelves of your own (any library's books on them), sorted or arranged by hand, shown on Home.
- Friends and Clubs with your Calibre Reader account: chats, friends, clubs to join, asking for a club.

What it needs
- Java 17 or later. Windows: CalibreReader.exe offers to download it if there is none (below);
  or install it yourself from https://adoptium.net. Linux: openjdk-17-jre or newer (the full one,
  not -headless); "Install Calibre Reader.sh" offers to download it if there is none (below).

System requirements
- Windows: Windows 10 or 11, 64-bit (x64), not in S mode; Windows Server 2016 or later.
  Windows 7 and 8.1 are not supported: Java 21 (Temurin) and the app's drawing library
  support Windows 10 and later, natural voices need Windows 8 or later, and CalibreReader.exe
  does not start there. With a Java you installed, "Calibre Reader.bat" may still start the
  app on them, untested; what goes wrong there may not be fixable.
  Windows 11 on ARM may run it through x64 emulation with an x64 Java (untested);
  Windows 10 on ARM cannot.
  If natural voices do not start, install Microsoft's
  "Visual C++ 2015-2022 Redistributable (x64)".
- Linux: x86_64, glibc 2.29 or later. That means Ubuntu 20.04+, Debian 11+, Fedora 30+,
  RHEL/Rocky/Alma 9+, openSUSE Leap 15.3+, or a current Arch. RHEL 8, Debian 10 and
  Ubuntu 18.04 are too old.
  You need the full Java runtime (openjdk-21-jre, not -headless), an X11 session or Wayland
  with XWayland, and OpenGL (libGL) or the software fallback. Sound goes through ALSA
  (PulseAudio and PipeWire through their ALSA plugins). No ARM64 build yet.
- Both: 4 GB RAM (8 GB for natural voices and films; an estimate).
  Disk: about 170 MB for the app, about 150 MB for Java, and about 140 MB of libraries
  unpacked on first use. Each natural voice you choose is 145-354 MB, then your books.
  A screen of 1280 x 800 or larger. Sound output for Read Aloud and media. Internet for
  servers, account and voices (a Local Library works offline).
- Details and how they were measured: docs/desktop-system-requirements.md in the source.

How to start it
- Windows: double-click CalibreReader.exe (below). "Calibre Reader.bat" still works too, with a Java you installed.
- Linux: double-click "Install Calibre Reader.sh" (below), or start it without installing: ./calibre-reader.sh
  (and ./install-menu-entry.sh once, to have that copy in your applications menu).

The window and the reader's keys
- Full screen: F11 (or View > Enter Full Screen) with a book open puts the reader over the whole
  screen, its bars hidden; move the pointer to the screen's top or bottom edge to see them.
  Escape or F11 leaves it.
- Ctrl+B in a book steps its text through the weights its font has (Regular, Medium, Semibold,
  Bold, ... as the font has them; Bolder for a font with one weight). The weight's name shows
  for a moment. Moving Themes & Settings > Boldness goes back to a boldness of your own.
- Windows: File, View, Go, Books and Help are in the window's title bar, beside its buttons
  (Alt or F10 opens them from the keyboard). To have Windows' own title bar with the menus
  under it, turn off Settings > Interface > Menus in the Title Bar.
- Help > Keyboard Shortcuts lists every key.

Starting on Windows
- Double-click CalibreReader.exe. Keep it in the same folder as CalibreReader.jar.
- Windows SmartScreen may say "Windows protected your PC", because CalibreReader.exe is not
  signed by a publisher Windows knows. Click "More info", then "Run anyway". Some antivirus
  programs distrust new unsigned programs too; if yours stops CalibreReader.exe, install Java
  yourself and use "Calibre Reader.bat".
- Java: it uses a Java 17 or later that is already there (one it downloaded before, then
  CALIBRE_READER_JAVA, JAVA_HOME, javaw.exe on the PATH, or an installed Java: Eclipse
  Adoptium/Temurin, Oracle, Microsoft, Azul Zulu, BellSoft Liberica). If there is none it asks
  first, then downloads Eclipse Temurin 21 from adoptium.net (free and open source; about 50 MB,
  checked against adoptium.net's SHA-256, with a progress window and Cancel) and keeps it in
  %LOCALAPPDATA%\CalibreReader\runtime (about 150 MB). Nothing else on the computer is changed,
  and nothing is left half-installed if the download fails or you cancel. Say No and it tells
  you where to get Java yourself. Behind a proxy it uses the HTTPS_PROXY variable, not the proxy
  set in Windows' settings; where only that one works, install Java yourself.
- The first time, it asks whether to add Calibre Reader to the Start menu and the desktop. If you
  said Yes and later move this folder, start CalibreReader.exe once from its new place and the
  shortcuts follow it. To be asked again, delete %APPDATA%\CalibreReader\launcher.json.
- A downloaded Java that you no longer want: delete the folder %LOCALAPPDATA%\CalibreReader\runtime.
- "Calibre Reader.bat" is kept for those who prefer it: it starts the app with the javaw on
  your PATH and never downloads anything.
- Open With: CalibreReader.exe puts Calibre Reader in Explorer's "Open with" for books, notes,
  documents, sound, films, fonts and pictures (for you alone; no file kind is taken from the app
  that opens it now), and opens its own themes (.crtheme). If you move this folder, start
  CalibreReader.exe once from its new place and Open With follows it.

Opening files, one window
- A file opened with Calibre Reader (Open With, a double-click, or named after the app on the command
  line) goes to Imported Files. With Calibre Reader open already, it goes to that window, which comes
  to the front: there is only ever one Calibre Reader.
- The menu entry's own menu (right-click it in the dock or the applications list on Linux) has
  Continue Reading, Continue Listening and Continue Reading Aloud.
- Linux: the keyboard's media keys, and the desktop's player in the panel and on the lock screen
  (GNOME, KDE and others, through MPRIS), play, pause and go to the next or previous chapter of what
  plays (an audiobook with no chapters: by Settings > Listening > Jump Without Chapters). Windows'
  media keys and its media overlay do not control Calibre Reader yet.

Installing on Linux
- Double-click "Install Calibre Reader.sh". If your file manager asks "Run or Display?", choose Run
  (or "Run in Terminal"). GNOME Files opens scripts as text: right-click the file and choose
  "Run as a Program". Or, in a terminal in this folder: sh "Install Calibre Reader.sh"
- No administrator password is needed: it installs for you alone. It copies the app to
  ~/.local/share/calibre-reader-app, puts Calibre Reader among your applications with its icon,
  and asks whether to put a shortcut on your desktop too.
- Java: it uses a Java 17 or later it finds (CALIBRE_READER_JAVA, JAVA_HOME, or java on your PATH;
  the full one, not -headless). If there is none it asks first, then either downloads
  Eclipse Temurin 21 from adoptium.net (about 50 MB, checked against its SHA-256, kept in
  ~/.local/share/calibre-reader-app/runtime, about 150 MB; nothing else is changed), or installs
  your distribution's Java with sudo (apt, dnf, zypper or pacman; pkexec when there is no terminal),
  or leaves it for you to install. If getting Java fails, nothing is installed; run it again.
- Running it again (for a newer version) updates the app and keeps the shortcut, Java and your books.
- To remove it: run ~/.local/share/calibre-reader-app/uninstall.sh (or "Install Calibre Reader.sh"
  --uninstall). It removes the app, its menu entry, icon and desktop shortcut, and asks whether to
  remove your books and settings (~/.local/share/calibre-reader) too; by default they stay.

Screen readers
- Windows: NVDA and JAWS read the app through the Java Access Bridge. Calibre Reader turns it on
  for itself when it starts (nothing to set, no jabswitch needed), with any Java that has it:
  Eclipse Temurin and the other full Java runtimes for Windows do. Narrator does not use the
  Java Access Bridge, so it may say little. To see what this computer gets:
  javaw -jar CalibreReader.jar --self-check (the line "screen readers").
  Each control's actions (a cover's Read Aloud and Book Details, a message's reactions, ...)
  are in its menu: the menu key or Shift+F10, as a right click. Adjustable controls (stars,
  the divider between two books) move with the arrow keys.
- Linux: Orca cannot read Calibre Reader yet: Compose for Desktop, which draws its windows,
  has no AT-SPI bridge. Read Aloud reads the books with the app's own voice.

If something goes wrong when it closes (Windows)
- Once everything is kept, Calibre Reader ends at once, without the slow steps in which an old
  input method (Google Pinyin) could crash and show its "Send Error Report" window.
  To look into a close that goes wrong, set CALIBRE_READER_EXIT to soft (input methods let go of,
  then Java closes as it used to) or plain (Java closes as it used to) before starting it, and
  send us state\exit.log from the folder below: it lists the last close's steps.
- An input method that is no longer updated (Google Pinyin's last version is from 2014) can still
  crash in other programs; Microsoft Pinyin, which comes with Windows, is the safer choice.

Where it keeps what it has
- Windows: %APPDATA%\CalibreReader     Linux: ~/.local/share/calibre-reader
